//
//  CXPayTypeCollectionCell.m

//

#import "CXPayTypeCollectionCell.h"
@interface CXPayTypeCollectionCell()
@property (weak, nonatomic) IBOutlet UIImageView *patTypeView;
@property (weak, nonatomic) IBOutlet UILabel     *payTypeLabel;
@property (weak, nonatomic) IBOutlet UIImageView *flagView;
@end
@implementation CXPayTypeCollectionCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

-(void)setModel:(CXPayTypeModel *)model
{
    _model = model;
    if ([_model.logo hasPrefix:@"http"])
    {
        [_patTypeView sd_setImageWithURL:[NSURL URLWithString:_model.logo] placeholderImage:HNTGetImage(@"bg_home") options:SDWebImageAllowInvalidSSLCertificates];
    }
    else
        _patTypeView.image = HNTGetImage(_model.logo);
    
    _payTypeLabel.text = _model.name;
    
    if([_model.isSelect isEqualToString:@"1"])
        _flagView.hidden = NO;
    else
        _flagView.hidden = YES;
}

@end
